﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Odin.Base.IO {
    public class KeyboardState {
        public byte[] bits = new byte[300];

        public KeyboardState() { }

        public KeyboardState(KeyboardState original) {
            for (int i = 0; i < bits.Length; i++) {
                bits[i] = original.bits[i];
            }
        }

        public bool IsKeyDown(Keys key) {
            // Check wether bit is set
            int keyIndex = (int)key;
            int result = 0;
            if (keyIndex > 0 && keyIndex < 300) {
                result = bits[keyIndex];
            }
            if (result > 0) {
                return true;
            } else {
                return false;
            }
        }
    }
}
